package com.celesea.auth.menu.vo;

import com.celesea.auth.menu.entity.Menu;
import com.celesea.framework.util.tree.ITree;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author JackYuan
 * @create 2017-10-28 21:29
 */
public class MenuTreeVo implements ITree<MenuTreeVo> {
    private String id;
    private String code;
    private String name;
    private String parentId;
    private Byte leaf;
    private List<MenuTreeVo> children;

    public MenuTreeVo() {
    }

    public MenuTreeVo(Menu entity) {
        this.id = entity.getId();
        this.code = entity.getCode();
        this.name = entity.getName();
        this.parentId = entity.getParentId();
        this.children = Lists.newArrayList();
    }

    @Override
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public Byte getLeaf() {
        return leaf;
    }

    @Override
    public void setLeaf(Byte leaf) {
        this.leaf = leaf;
    }

    @Override
    public List<MenuTreeVo> getChildren() {
        return children;
    }

    @Override
    public void setChildren(List<MenuTreeVo> children) {
        this.children = children;
    }

    @Override
    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
